using System;
using System.Collections.Generic;
using System.Text;
using OWED.Document;

namespace ClientGUI.Information_Experts
{
    /// <summary>
    /// A queue of ChangeAtoms
    /// </summary>
    public class ChangeAtomQueue
    {
        private List<ChangeAtom> list = new List<ChangeAtom>();

        /// <summary>
        /// Add a ChangeAtom to the end of the queue
        /// </summary>
        /// <param name="ca"></param>
        public void AddChangeAtom(ChangeAtom ca)
        {
            list.Add(ca);
        }

        /// <summary>
        /// Add a list of change atoms all at once, preserving the order.
        /// </summary>
        /// <param name="toAppend"></param>
        public void AddChangeAtoms(List<ChangeAtom> toAppend)
        {
            list.AddRange(toAppend);
        }

        /// <summary>
        /// Clears the ChangeAtoms (for resetting)
        /// </summary>
        public void ClearChangeAtoms()
        {
            list.Clear();
        }

        /// <summary>
        /// Returns a copy of the local change atom queue.
        /// </summary>
        /// <returns>new copy</returns>
        public List<ChangeAtom> GetChangeAtoms()
        {
            return new List<ChangeAtom>(list);
        }

    }
}
